home *** CD-ROM | disk | FTP | other *** search
- # C a r r o l l - N e t, Inc.
- #
- # Trumpet Winsock 2.1 Login.cmd
- #
- # Copyright (C) 1994,1995 Peter R. Tattam &
- # Trumpet Software International Pty Ltd (TSI)
- # All rights reserved.
- #
- # Unless TSI has given prior written consent to such use,
- # no permission is granted to distribute or otherwise make available
- # to the public modified versions of this script for commercial purposes.
- # Any permitted distribution of modified versions of the script must
- # retain the copyright notice at the start of this file and must clearly
- # identify those parts of the file which have been modified.
- #
- # version 960108 added support for 2.0b
- # version 951224 removed additional dialups
- #
-
- set dtr off
-
- #trace on
- #
- # set up some strings for dialling up
- #
- display \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
-
- if ![load $anumber]
- display "You need to run the Dialler/Setup.cmd script, e1"
- abort
- end
-
- if ![load $bnumber]
- display "You need to run the Dialler/Setup.cmd script, e2"
- abort
- end
-
- if ![load $username]
- display "You need to run the Dialler/Setup.cmd script, e5"
- abort
- end
-
- if ![load $password]
- display "You need to run the Dialler/Setup.cmd script, e6"
- abort
- end
-
- if ![load $modeminit]
- display "You need to run the Dialler/Setup.cmd script, e7"
- abort
- end
-
- if ![load %attempts]
- display "You need to run the Dialler/Setup.cmd script, e8"
- abort
- end
-
- $userprompt = "login:"
- $passprompt = "sword:"
-
- #
- # send phone number
- #
- $num = ""
- %which = 0
- %n = 0
- repeat
- set dtr off
- sleep 1
- set dtr on
- sleep 1
- #
- # setup our modem commands
- #
- output "at"$modeminit\13
- if ! [input 5 OK\n]
- display "Modem is not responding"
- abort
- end
- %n = %n + 1
- if %n > %attempts
- display "Too many dial attempts"
- abort
- end
- %which = %which + 1
- if %which > 2
- %which = 1
- end
- if %which = 1
- $num = $anumber
- end
- if %which = 2
- $num = $bnumber
- end
- display Dialing $num...(attempt %n)\n
- output "atdt"$num\13
- display \n
- %ok = [input 30 CONNECT]
- until %ok
- input 10 \n
-
- #
- # wait till it's safe to send because some modem's hang up
- # if you transmit during the connection phase
- #
- wait 10 dcd
- display \nModems are now connected.\n
-
- #
- # wait for the username prompt
- #
- display \nTrying to login with username $username\n
- input 5 $userprompt
- output $username\13
-
- #
- # and the password
- #
- input 2 $passprompt
- output $password\13
-
- #
- # we are now logged in
- #
- %ok = [input 3 PPP]
- if !%ok
- display \n\nYou were unable to login. The most likely cause is that\n
- display you have an invalid username or password. Please re-run\n
- display Dialler/Setup.cmd, and re-type the information\n
- abort
- end
-
- display \n\nLogged in. Now trying to bring up PPP Session\n\n
- display Your session will be active when you see a series of\n
- display non-zero digits following the string \"My IP address =\"\n\n
-
- sleep 1